﻿using System;
using System.Collections.Generic;
using System.Text;

namespace KGE.Define
{
    public class intQueue
    {
        List<int> actionQueue = new List<int>();
        public int Count
        {
            get
            {
                return actionQueue.Count;
            }
        }
        public void Enqueue(int v)
        {
            //foreach (int i in actionQueue)
            //{
            //    if (v == i)
            //    {
            //        return;
            //    }
            //}
            actionQueue.Add(v);
        }
        public void EnqueueCheckLast(int v)
        {
            if (actionQueue.Count > 0)
            {
                if (actionQueue[actionQueue.Count - 1] == v)
                {
                    return;
                }
            }
            actionQueue.Add(v);
        }
        public int Dequeue()
        {
            int v = -1;
            if (actionQueue.Count > 0)
            {
                v = actionQueue[0];
                actionQueue.RemoveAt(0);
            }
            return v;
        }
        public int Pop()
        {
            int v = -1;
            if (actionQueue.Count > 0)
            {
                v = actionQueue[actionQueue.Count - 1];
            }
            return v;
        }
        public intQueue()
        { 
        }
    }
}
